import http from '../util/http.js'

const signInUrl = '/user/queryByAccountAndPassword'
const queryAllUrl = '/user/queryAll'
const removeByIdUrl = '/user/removeById'
const queryByAccountUrl = '/user/queryByAccount'
const createUrl = '/user/create'
const queryByIdUrl = '/user/queryById'
const modifyUrl = '/user/modify'
const signOutUrl = '/user/signOut'

const signIn = (data) => {
    return http.post(signInUrl, data)
}

const queryAll = (data) => {
    return http.get(queryAllUrl, data)
}

const removeById = (data) => {
    return http.del(removeByIdUrl, data)
}

const queryByAccount = (data) => {
    return http.get(queryByAccountUrl, data)
}

const create = (data) => {
    return http.post(createUrl, data,'multipart/form-data')
}

const queryById = (data) => {
    return http.get(queryByIdUrl, data)
}

const modify = (data) => {
    return http.put(modifyUrl, data,'multipart/form-data')
}

const signOut = () => {
    return http.post(signOutUrl);
}

export default {
    signIn, queryAll, removeById, queryByAccount, create, queryById, modify,signOut
}